import { createApp } from 'vue'
import './style.css'
import App from './App.vue'
import 'reset.css'
import 'virtual:uno.css'
import router from './router'
import zhCn from 'element-plus/es/locale/lang/zh-cn' //汉化日期选择器
import ElementPlus from 'element-plus'
import 'element-plus/dist/index.css'
import * as ElementPlusIconsVue from '@element-plus/icons-vue'
import 'element-plus/dist/index.css'
import { createPinia } from 'pinia'
// vxe-table
import VXETable from 'vxe-table'
import 'vxe-table/lib/style.css'
import piniaPluginPersistedstate from "pinia-plugin-persistedstate";// 状态机持久化存储
import './assets/font/iconfont.css'; // 引入自定义图标样式文件 
import Cloud from "leancloud-storage";//sdk
import { BASEURL, ID, KEY } from './configs'
import print from 'vue3-print-nb'
// 引入leanCloud的sdk加载图片资源
//解决ElMessage不生效
import 'element-plus/theme-chalk/src/message.scss'
import 'element-plus/theme-chalk/src/index.scss'
let app = createApp(App)
// icon图标引入
for (const [key, component] of Object.entries(ElementPlusIconsVue)) {
    app.component(key, component)
}
Cloud.init({
    appId: ID,
    appKey: KEY,
    serverURL: BASEURL
});
const pinia = createPinia();
pinia.use(piniaPluginPersistedstate); //给pinia配置plugin
function useTable(app: any) {
    app.use(VXETable)
}
app.use(ElementPlus, {
    locale: zhCn
})
app.use(pinia)// 状态机
app.use(router)
app.use(print)//打印
app.use(useTable)//高级表格
app.mount('#app')